<template>
  <div>
    <el-table
      :data="recordList"
      style="width: 100%">
      <el-table-column
        prop="id"
        label="编号">
      </el-table-column>
      <el-table-column
        prop="name"
        label="奖惩">
      </el-table-column>
      <el-table-column
        label="学生">
        <template>
          {{$route.query.stuName}}
        </template>
      </el-table-column>

      <el-table-column
        prop="des"
        label="描述">
      </el-table-column>
      <el-table-column
        prop="createBy"
        label="创建人">
      </el-table-column>

    </el-table>

  </div>
</template>

<script>
    export default {
      data(){
          return {
            recordList:[]
          }
      },
      watch:{//可以监听变量的变化
        $route(to,from){
          this.axios.get("/record/selectByStuId/"+this.$route.query.stuId).then((resp)=>{
            this.recordList=resp.data;
          });
        }
      }
    }
</script>

<style scoped>

</style>
